Skip to content

Feature added for stack-guard - #6

Closed
shivgarg wants to merge 2 commits into
masterfrom
stack-guard
Closed

shivgarg wants to merge 2 commits into
masterfrom
stack-guard

Conversation

@shivgarg

Copy link
Copy Markdown
Contributor

Added the feature of hardware enabled stack guard. The exception is raised on stack overflow for the tasks. This is completely monitored and controlled by the hardware configuration.

Added the feature of hardware enabled stack guard. The exception is raised on stack overflow for the tasks. This is completely
monitored and controlled by the hardware configuration.

@juitem juitem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please seperate hello_main.c
from thic commit?
Let's push MPU application testing features be out ot hello example

@btheosam btheosam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few questions;

  1. Stack creation of idle task is not through up_createstack(), hope idle tak's stack is also acommodated?
  2. How exception is triggered? is it when stack guard is overwritten by different task or any part of stack is overwittern by another task?
  3. Does these changes take care of both task as well thread stack?

@girishks2000

Copy link
Copy Markdown
Contributor

@btheosam
1.This doesn't include Idle task. Since it is statically allocated initially, tcb->stack_alloc_ptr is NULL, If you check the setup_guard_region(), we are not handling it but just skipping it. It can be handled similarly as other tasks.
2. Exception is raised only when guard region is accessed by same or other task according to this feature. The stack contents cannot be overwritten by other tasks because, during the current context, only current stack is accessible by the task. Anything outside this range set to SP should raise exception.
3. This change handles at the lowest tcb data structure which is common for bot task and thread.

@girishks2000

Copy link
Copy Markdown
Contributor

@juitem
There is no need to add a patch for removing hello_main.c. If you pick 3 patches related to stack guard, it is already done. Please donot add another patch for removal

@girishks2000

Copy link
Copy Markdown
Contributor

@ALL committing stack guard patches.
Please don't pick only base patch for this feature. You need to pick all the 3 patches. These have been tested for complete functionality. And revert the current patch for hello_main.c removal

@shivgarg shivgarg closed this Apr 13, 2017
@sunghan-chang
sunghan-chang deleted the stack-guard branch May 16, 2017 05:58
seokhun-eom24 added a commit to seokhun-eom24/TizenRT that referenced this pull request Nov 12, 2026
mbedTLS 3.4 builds fail because MBEDTLS_CERTS_C is unavailable and key parsing requires RNG arguments.
Drop the obsolete feature check and export tls_handshake_server in the fallback.
Seed CTR_DRBG before key parsing and pass its RNG callback and context.

[Result]
```
TASH>>tls_seclink
TASH>>-- [TLS SECLINK TEST] START --
Hello, TLS Server Test
[SERVER]   . Seeding the random number generator...[SERVER]  ok
[SERVER]   . Loading the server cert. and key...[SERVER]  ok
[SERVER]   . Bind on https://localhost:4433/ ...[SERVER]  ok
[SERVER]   . Setting up the SSL data....[SERVER]  ok
[SERVER]   . Waiting for a remote connection ...Hello, TLS Clinet Test
[CLIENT]   . Seeding the random number generator...[CLIENT]  ok
[CLIENT]   . Loading the CA root certificate ...[CLIENT]  ok (0 skipped)
[CLIENT]   . Connecting to tcp/127.0.0.1/4433...[SERVER]  ok
[SERVER]   . Performing the SSL/TLS handshake...[CLIENT]  ok
[CLIENT]   . Setting up the SSL/TLS structure...[CLIENT]  ok
[CLIENT]   . Performing the SSL/TLS handshake...[SERVER]  ok
[SERVER]   < Read from client:
[CLIENT]  ok
[CLIENT]   . Verifying peer X.509 certificate...[CLIENT]  ok
[CLIENT]   > Start Packet Perfomance Test [28]
[CLIENT] Try Write #1 [ 64 bytes ] -->
[CLIENT] Try Write #1 Done <--
[CLIENT] Try Write #2 [ 128 bytes ] -->
[CLIENT] Try Write #2 Done <--
[CLIENT] Try Write #3 [ 256 bytes ] -->
[CLIENT] Try Write #3 Done <--
[CLIENT] Try Write #4 [ 512 bytes ] -->
[CLIENT] Try Write #4 Done <--
[CLIENT] Try Write Samsung#5 [ 1024 bytes ] -->
[CLIENT] Try Write Samsung#5 Done <--
[CLIENT] Try Write Samsung#6 [ 2048 bytes ] -->
[CLIENT] Try Write Samsung#6 Done <--
[CLIENT] Try Write Samsung#7 [ 4096 bytes ] -->
[CLIENT] Try Write Samsung#7 Done <--
[CLIENT]   < Read from server:
[SERVER]   > Start Packet Perfomance Test [28]
[SERVER]   . Closing the connection...[SERVER]  ok
[CLIENT]  64 bytes read
[CLIENT]  128 bytes read
[CLIENT]  256 bytes read
[CLIENT]  512 bytes read
[CLIENT]  1024 bytes read
[CLIENT]  2048 bytes read
[CLIENT]  4096 bytes read
[CLIENT] End : 0 --
[SERVER] End : 0 --
-- [TLS SECLINK TEST] Success --
-------------------------------------------------------------------------------------------
        |        64 |       128 |       256 |       512 |      1024 |      2048 |      4096 |
-------------------------------------------------------------------------------------------
Encrypt |      1020 |      1290 |      2190 |      3840 |     21870 |     26700 |     26040 |
Decrypt |       990 |      1230 |      1950 |      3570 |      6720 |     12750 |     25170 |
-------------------------------------------------------------------------------------------
-- [TLS SECLINK TEST] DONE --
```

Co-authored-by: Codex
Signed-off-by: seokhun-eom <seokhun.eom@samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants